package com.woniu.his.config;

import org.apache.shiro.crypto.hash.SimpleHash;

public class EntryptRule {
    public static final String HASH_NAME = "SHA-256";
    public static final int HASH_ITERATION = 1;

    public static String entrypt(String password) {
        //配置规则 放入规则和密码
        SimpleHash simpleHash = new SimpleHash(HASH_NAME, password);
        //设置迭代次数
        simpleHash.setIterations(HASH_ITERATION);
        //将结果转换成String返回
        return simpleHash.toString();
    }
}
